package junit;

import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;

import junit.framework.Assert;
import myExceptions.MyFileException;

import org.junit.Before;
import org.junit.Test;

import questionary.Questionary;

public class QuestionaryTest {
	
	private Questionary q;
	private BufferedReader buf;
	
	@Before
	public void init () {
		
		try {
			buf = new BufferedReader(new FileReader("preguntas.txt"));
		} catch (FileNotFoundException e) {
			e.printStackTrace();
		}
		
		try {
			q = new Questionary(buf, "Easy");
		} catch (MyFileException e) {
			e.printStackTrace();
		}
	}
	
	@Test
	public void testQuestionaryBis() {
       Assert.assertTrue(q.getCountQ() == 10);
       Assert.assertTrue(q.getDifficulty() == 0);
	}

}
